package com.novax.ex.activity.open.api.inner;

import com.novax.ex.activity.open.model.request.RankConfigRequest;
import com.novax.ex.activity.open.model.response.RankApplyUserResponse;
import com.novax.ex.activity.open.model.response.RankConfigResponse;
import com.novax.ex.common.results.ReturnResult;
import com.novax.ex.common.util.PageQuery;
import com.novax.ex.common.util.PageUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import jakarta.validation.Valid;
import java.util.List;

/**
 * summary: 后台-排名赛配置
 *
 * @author shaw
 * @date 11/30/22 11:14
 */
@Tag(name = "排名赛配置", description = "排名赛配置")
@FeignClient(url = "${remote.activity-service.endpoint}", name = "RankConfigInnerApi", contextId = "RankConfigInnerApi")
public interface RankConfigInnerApi {

    @Operation(summary = "排名赛活动配置分页查询")
    @GetMapping("/v3/private/rank-page")
    ReturnResult<PageUtil<RankConfigResponse>> page(@ParameterObject PageQuery pageQuery);

    @Operation(summary = "排名赛活动配置新增")
    @PostMapping("/v3/private/rank")
    ReturnResult<?> add(@RequestHeader("language") String language,
                        @Valid @RequestBody RankConfigRequest rankConfigRequest,
                        BindingResult bindingResult);

    @Operation(summary = "排名赛活动配置修改")
    @PostMapping("/v3/private/rank/{rankId}")
    ReturnResult<?> modify(@RequestHeader("language") String language,
                           @PathVariable("rankId") Long rankId,
                           @RequestBody RankConfigRequest rankConfigRequest);

    @Operation(summary = "下载报名数据")
    @GetMapping("/v3/private/rank/apply/{rankId}")
    ReturnResult<List<RankApplyUserResponse>> queryApplyUserIdList(@PathVariable("rankId") Long rankId);

}